package wxy;

public class LeetCode1684 {
    public int countConsistentStrings(String allowed, String[] words) {
        int[] arr = new int[26];
        for (char c : allowed.toCharArray()) {
            arr[c - 'a'] = 1;
        }
        int count = 0;
        for (String word : words) {
            boolean b = true;
            for (char c : word.toCharArray()) {
                if (arr[c - 'a'] != 1) {
                    b = false;
                    break;
                }
            }
            if (b) {
                count++;
            }
        }
        return count;
    }
}
